<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tinyOS: tMutex.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">tinyOS
   &#160;<span id="projectnumber">v1.00</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('t_mutex_8c_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">tMutex.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="t_mutex_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="t_mutex_8h.html">tMutex.h</a>&quot;</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="tiny_o_s_8h.html">tinyOS.h</a>&quot;</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#if !defined(TINYOS_ENABLE_MUTEX) || TINYOS_ENABLE_MUTEX == 1</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#gae12a3d5db0c3834e8a3837358f4f3302">   23</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#gae12a3d5db0c3834e8a3837358f4f3302">tMutexInit</a> (<a class="code" href="struct__t_mutex.html">tMutex</a> *mutex) {</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga5ca43de9442770133c4c2ac38e696049">tEventInit</a>(&amp;mutex-&gt;<a class="code" href="struct__t_mutex.html#a8b516ab130f86e4b15ca025c98c3dc53">event</a>, <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gga38c1e3a16130027049cb697b78b5d11ca0c200498700fa5c347791d1a740848ad">tEventTypeMutex</a>);</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    mutex-&gt;<a class="code" href="struct__t_mutex.html#a16598f387191bb413e5c802b23e501ef">lockedCount</a> = 0;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a> = (<a class="code" href="struct__t_task.html">tTask</a> *) 0;</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    mutex-&gt;<a class="code" href="struct__t_mutex.html#aa1d8803bb70576a417cba7092640ebd3">ownerOriginalPrio</a> = TINYOS_PRO_COUNT;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;}</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga2608713c70ae2de620f39566c023abe9">   37</a></span>&#160;uint32_t <a class="code" href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga2608713c70ae2de620f39566c023abe9">tMutexWait</a> (<a class="code" href="struct__t_mutex.html">tMutex</a> *mutex, uint32_t waitTicks) {</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    <span class="keywordflow">if</span> (mutex-&gt;<a class="code" href="struct__t_mutex.html#a16598f387191bb413e5c802b23e501ef">lockedCount</a> &lt;= 0) {</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;        <span class="comment">// 如果没有锁定，则使用当前任务锁定</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;        mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a> = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        mutex-&gt;<a class="code" href="struct__t_mutex.html#aa1d8803bb70576a417cba7092640ebd3">ownerOriginalPrio</a> = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a>;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        mutex-&gt;<a class="code" href="struct__t_mutex.html#a16598f387191bb413e5c802b23e501ef">lockedCount</a>++;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc">tErrorNoError</a>;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        <span class="comment">// 信号量已经被锁定</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;        <span class="keywordflow">if</span> (mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a> == <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>) {</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;            <span class="comment">// 如果是信号量的拥有者再次wait，简单增加计数</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;            mutex-&gt;<a class="code" href="struct__t_mutex.html#a16598f387191bb413e5c802b23e501ef">lockedCount</a>++;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;            <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc">tErrorNoError</a>;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;        } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;            <span class="comment">// 如果是信号量拥有者之外的任务wait，则要检查下是否需要使用</span></div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;            <span class="comment">// 优先级继承方式处理</span></div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a> &lt; mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a>-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a>) {</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;                <a class="code" href="struct__t_task.html">tTask</a> *owner = mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a>;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;                <span class="comment">// 如果当前任务的优先级比拥有者优先级更高，则使用优先级继承</span></div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;                <span class="comment">// 提升原拥有者的优先</span></div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;                <span class="keywordflow">if</span> (owner-&gt;<a class="code" href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a> == <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gae9796d3f7bdb820b16b7ca53a44bcbd0">TINYOS_TASK_STATE_RDY</a>) {</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;                    <span class="comment">// 任务处于就绪状态时，更改任务在就绪表中的位置</span></div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;                    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f3aa47609478099b79d1520a9baf9b3">tTaskSchedUnRdy</a>(owner);</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;                    owner-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a> = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a>;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;                    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab7c2dfbda696e43a8c35ab97731837a0">tTaskSchedRdy</a>(owner);</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;                } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;                    <span class="comment">// 其它状态，只需要修改优先级</span></div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;                    owner-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a> = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a>;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;                }</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;            }</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;            <span class="comment">// 当前任务进入等待队列中</span></div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;            <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga0bbda829b0d83072138caad66f98899a">tEventWait</a>(&amp;mutex-&gt;<a class="code" href="struct__t_mutex.html#a8b516ab130f86e4b15ca025c98c3dc53">event</a>, <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>, (<span class="keywordtype">void</span> *) 0, <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gga38c1e3a16130027049cb697b78b5d11ca0c200498700fa5c347791d1a740848ad">tEventTypeMutex</a>, waitTicks);</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;            <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;            <span class="comment">// 执行调度， 切换至其它任务</span></div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;            <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gaeb48f2b93febc962f23d9a6a72db9d8e">tTaskSched</a>();</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>-&gt;<a class="code" href="struct__t_task.html#a37707d87e42a484588393e5b3683ffbb">waitEventResult</a>;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        }</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    }</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;}</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div><div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga26ec3e3848541464c9ba38de67875e11">   91</a></span>&#160;uint32_t <a class="code" href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga26ec3e3848541464c9ba38de67875e11">tMutexNoWaitGet</a> (<a class="code" href="struct__t_mutex.html">tMutex</a> *mutex) {</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="keywordflow">if</span> (mutex-&gt;<a class="code" href="struct__t_mutex.html#a16598f387191bb413e5c802b23e501ef">lockedCount</a> &lt;= 0) {</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        <span class="comment">// 如果没有锁定，则使用当前任务锁定</span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;        mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a> = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>;</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;        mutex-&gt;<a class="code" href="struct__t_mutex.html#aa1d8803bb70576a417cba7092640ebd3">ownerOriginalPrio</a> = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a>;</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;        mutex-&gt;<a class="code" href="struct__t_mutex.html#a16598f387191bb413e5c802b23e501ef">lockedCount</a>++;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc">tErrorNoError</a>;</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        <span class="comment">// 信号量已经被锁定</span></div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;        <span class="keywordflow">if</span> (mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a> == <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>) {</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;            <span class="comment">// 如果是信号量的拥有者再次wait，简单增加计数</span></div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;            mutex-&gt;<a class="code" href="struct__t_mutex.html#a16598f387191bb413e5c802b23e501ef">lockedCount</a>++;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;            <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc">tErrorNoError</a>;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;        }</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aa255993b8e7a6ec085f545b2cb4b0e161">tErrorResourceUnavaliable</a>;</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    }</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;}</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#gad192db653abe0e792860dccd9e4050ba">  122</a></span>&#160;uint32_t <a class="code" href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#gad192db653abe0e792860dccd9e4050ba">tMutexNotify</a> (<a class="code" href="struct__t_mutex.html">tMutex</a> *mutex) {</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    <span class="keywordflow">if</span> (mutex-&gt;<a class="code" href="struct__t_mutex.html#a16598f387191bb413e5c802b23e501ef">lockedCount</a> &lt;= 0) {</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        <span class="comment">// 锁定计数为0，信号量未被锁定，直接退出</span></div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc">tErrorNoError</a>;</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    }</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <span class="keywordflow">if</span> (mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a> != <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>) {</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;        <span class="comment">// 不是拥有者释放，认为是非法</span></div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aadbf11a8eef09c91538ceeea00fbef507">tErrorOwner</a>;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    }</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    <span class="keywordflow">if</span> (--mutex-&gt;<a class="code" href="struct__t_mutex.html#a16598f387191bb413e5c802b23e501ef">lockedCount</a> &gt; 0) {</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;        <span class="comment">// 减1后计数仍不为0, 直接退出，不需要唤醒等待的任务</span></div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc">tErrorNoError</a>;</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    }</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    <span class="comment">// 是否有发生优先级继承</span></div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <span class="keywordflow">if</span> (mutex-&gt;<a class="code" href="struct__t_mutex.html#aa1d8803bb70576a417cba7092640ebd3">ownerOriginalPrio</a> != mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a>-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a>) {</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;        <span class="comment">// 有发生优先级继承，恢复拥有者的优先级</span></div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;        <span class="keywordflow">if</span> (mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a>-&gt;<a class="code" href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a> == <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gae9796d3f7bdb820b16b7ca53a44bcbd0">TINYOS_TASK_STATE_RDY</a>) {</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;            <span class="comment">// 任务处于就绪状态时，更改任务在就绪表中的位置</span></div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;            <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f3aa47609478099b79d1520a9baf9b3">tTaskSchedUnRdy</a>(mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a>);</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;            <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a> = mutex-&gt;<a class="code" href="struct__t_mutex.html#aa1d8803bb70576a417cba7092640ebd3">ownerOriginalPrio</a>;</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;            <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab7c2dfbda696e43a8c35ab97731837a0">tTaskSchedRdy</a>(mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a>);</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;        } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;            <span class="comment">// 其它状态，只需要修改优先级</span></div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;            <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a> = mutex-&gt;<a class="code" href="struct__t_mutex.html#aa1d8803bb70576a417cba7092640ebd3">ownerOriginalPrio</a>;</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;        }</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    }</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    <span class="comment">// 检查是否有任务等待</span></div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga312cd12071f2d18172b4020079af49a2">tEventWaitCount</a>(&amp;mutex-&gt;<a class="code" href="struct__t_mutex.html#a8b516ab130f86e4b15ca025c98c3dc53">event</a>) &gt; 0) {</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;        <span class="comment">// 如果有的话，则直接唤醒位于队列首部（最先等待）的任务</span></div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        <a class="code" href="struct__t_task.html">tTask</a> *task = <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gae1e675e01faa9fd2a37ab29b2092d646">tEventWakeUp</a>(&amp;mutex-&gt;<a class="code" href="struct__t_mutex.html#a8b516ab130f86e4b15ca025c98c3dc53">event</a>, (<span class="keywordtype">void</span> *) 0, <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc">tErrorNoError</a>);</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;        mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a> = task;</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;        mutex-&gt;<a class="code" href="struct__t_mutex.html#aa1d8803bb70576a417cba7092640ebd3">ownerOriginalPrio</a> = task-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a>;</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;        mutex-&gt;<a class="code" href="struct__t_mutex.html#a16598f387191bb413e5c802b23e501ef">lockedCount</a>++;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;        <span class="comment">// 如果这个任务的优先级更高，就执行调度，切换过去</span></div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;        <span class="keywordflow">if</span> (task-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a> &lt; <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a>) {</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;            <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gaeb48f2b93febc962f23d9a6a72db9d8e">tTaskSched</a>();</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;        }</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    }</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc">tErrorNoError</a>;</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;}</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;</div><div class="line"><a name="l00180"></a><span class="lineno"><a class="line" href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga8e1b65bea50a87032971eb167d411723">  180</a></span>&#160;uint32_t <a class="code" href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga8e1b65bea50a87032971eb167d411723">tMutexDestroy</a> (<a class="code" href="struct__t_mutex.html">tMutex</a> *mutex) {</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    uint32_t count = 0;</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    <span class="comment">// 信号量是否已经被锁定，未锁定时没有任务等待，不必处理</span></div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    <span class="keywordflow">if</span> (mutex-&gt;<a class="code" href="struct__t_mutex.html#a16598f387191bb413e5c802b23e501ef">lockedCount</a> &gt; 0) {</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;        <span class="comment">// 是否有发生优先级继承?如果发生，需要恢复拥有者的原优先级</span></div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;        <span class="keywordflow">if</span> (mutex-&gt;<a class="code" href="struct__t_mutex.html#aa1d8803bb70576a417cba7092640ebd3">ownerOriginalPrio</a> != mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a>-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a>) {</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;            <span class="comment">// 有发生优先级继承，恢复拥有者的优先级</span></div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;            <span class="keywordflow">if</span> (mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a>-&gt;<a class="code" href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">state</a> == <a class="code" href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gae9796d3f7bdb820b16b7ca53a44bcbd0">TINYOS_TASK_STATE_RDY</a>) {</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;                <span class="comment">// 任务处于就绪状态时，更改任务在就绪表中的位置</span></div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;                <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f3aa47609478099b79d1520a9baf9b3">tTaskSchedUnRdy</a>(mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a>);</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;                mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a>-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a> = mutex-&gt;<a class="code" href="struct__t_mutex.html#aa1d8803bb70576a417cba7092640ebd3">ownerOriginalPrio</a>;</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;                <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab7c2dfbda696e43a8c35ab97731837a0">tTaskSchedRdy</a>(mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a>);</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;            } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;                <span class="comment">// 其它状态，只需要修改优先级</span></div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;                mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a>-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a> = mutex-&gt;<a class="code" href="struct__t_mutex.html#aa1d8803bb70576a417cba7092640ebd3">ownerOriginalPrio</a>;</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;            }</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;        }</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;        <span class="comment">// 然后，清空事件控制块中的任务</span></div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;        count = <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gace850c06cc2fc2f07296e1eb4552030a">tEventRemoveAll</a>(&amp;mutex-&gt;<a class="code" href="struct__t_mutex.html#a8b516ab130f86e4b15ca025c98c3dc53">event</a>, (<span class="keywordtype">void</span> *) 0, <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aa6c274bf418a43d0cf80e68161aad9d8e">tErrorDel</a>);</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;        <span class="comment">// 清空过程中可能有任务就绪，执行一次调度</span></div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;        <span class="keywordflow">if</span> (count &gt; 0) {</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;            <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gaeb48f2b93febc962f23d9a6a72db9d8e">tTaskSched</a>();</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;        }</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    }</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;</div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;    <span class="keywordflow">return</span> count;</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;}</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;</div><div class="line"><a name="l00218"></a><span class="lineno"><a class="line" href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga01ba0fbff6eaeae119c26db5573f358a">  218</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga01ba0fbff6eaeae119c26db5573f358a">tMutexGetInfo</a> (<a class="code" href="struct__t_mutex.html">tMutex</a> *mutex, <a class="code" href="struct__t_mutex_info.html">tMutexInfo</a> *info) {</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    <span class="comment">// 拷贝需要的信息</span></div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    info-&gt;<a class="code" href="struct__t_mutex_info.html#a80462c64b9184115aa568f08227f7f4a">taskCount</a> = <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga312cd12071f2d18172b4020079af49a2">tEventWaitCount</a>(&amp;mutex-&gt;<a class="code" href="struct__t_mutex.html#a8b516ab130f86e4b15ca025c98c3dc53">event</a>);</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    info-&gt;<a class="code" href="struct__t_mutex_info.html#a2ad329dc18ddf3afd170e73535c5907a">ownerPrio</a> = mutex-&gt;<a class="code" href="struct__t_mutex.html#aa1d8803bb70576a417cba7092640ebd3">ownerOriginalPrio</a>;</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    <span class="keywordflow">if</span> (mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a> != (<a class="code" href="struct__t_task.html">tTask</a> *) 0) {</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;        info-&gt;<a class="code" href="struct__t_mutex_info.html#ad2ca878c1d7b4012ae3954a79aa664ef">inheritedPrio</a> = mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a>-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a>;</div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;        info-&gt;<a class="code" href="struct__t_mutex_info.html#ad2ca878c1d7b4012ae3954a79aa664ef">inheritedPrio</a> = TINYOS_PRO_COUNT;</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    }</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;    info-&gt;<a class="code" href="struct__t_mutex_info.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a> = mutex-&gt;<a class="code" href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">owner</a>;</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;    info-&gt;<a class="code" href="struct__t_mutex_info.html#a16598f387191bb413e5c802b23e501ef">lockedCount</a> = mutex-&gt;<a class="code" href="struct__t_mutex.html#a16598f387191bb413e5c802b23e501ef">lockedCount</a>;</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;}</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;</div><div class="ttc" id="t_mutex_8h_html"><div class="ttname"><a href="t_mutex_8h.html">tMutex.h</a></div></div>
<div class="ttc" id="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_html_ga01ba0fbff6eaeae119c26db5573f358a"><div class="ttname"><a href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga01ba0fbff6eaeae119c26db5573f358a">tMutexGetInfo</a></div><div class="ttdeci">void tMutexGetInfo(tMutex *mutex, tMutexInfo *info)</div><div class="ttdef"><b>Definition:</b> <a href="t_mutex_8c_source.html#l00218">tMutex.c:218</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gga79eea102ac8c9dc0bcce5f8c63ccc55aadbf11a8eef09c91538ceeea00fbef507"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aadbf11a8eef09c91538ceeea00fbef507">tErrorOwner</a></div><div class="ttdef"><b>Definition:</b> <a href="tiny_o_s_8h_source.html#l00039">tinyOS.h:39</a></div></div>
<div class="ttc" id="struct__t_task_html"><div class="ttname"><a href="struct__t_task.html">_tTask</a></div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00031">tTask.h:31</a></div></div>
<div class="ttc" id="struct__t_mutex_info_html_ad2ca878c1d7b4012ae3954a79aa664ef"><div class="ttname"><a href="struct__t_mutex_info.html#ad2ca878c1d7b4012ae3954a79aa664ef">_tMutexInfo::inheritedPrio</a></div><div class="ttdeci">uint32_t inheritedPrio</div><div class="ttdef"><b>Definition:</b> <a href="t_mutex_8h_source.html#l00037">tMutex.h:37</a></div></div>
<div class="ttc" id="struct__t_mutex_info_html_a80462c64b9184115aa568f08227f7f4a"><div class="ttname"><a href="struct__t_mutex_info.html#a80462c64b9184115aa568f08227f7f4a">_tMutexInfo::taskCount</a></div><div class="ttdeci">uint32_t taskCount</div><div class="ttdef"><b>Definition:</b> <a href="t_mutex_8h_source.html#l00034">tMutex.h:34</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_gace850c06cc2fc2f07296e1eb4552030a"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gace850c06cc2fc2f07296e1eb4552030a">tEventRemoveAll</a></div><div class="ttdeci">uint32_t tEventRemoveAll(tEvent *event, void *msg, uint32_t result)</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8c_source.html#l00163">tEvent.c:163</a></div></div>
<div class="ttc" id="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_html_gad192db653abe0e792860dccd9e4050ba"><div class="ttname"><a href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#gad192db653abe0e792860dccd9e4050ba">tMutexNotify</a></div><div class="ttdeci">uint32_t tMutexNotify(tMutex *mutex)</div><div class="ttdef"><b>Definition:</b> <a href="t_mutex_8c_source.html#l00122">tMutex.c:122</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gab4d6c802c474b9071f48312bed3dec74"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a></div><div class="ttdeci">tTaskCritical_t tTaskEnterCritical(void)</div><div class="ttdef"><b>Definition:</b> <a href="t_switch_8c_source.html#l00036">tSwitch.c:36</a></div></div>
<div class="ttc" id="struct__t_mutex_html_aa1d8803bb70576a417cba7092640ebd3"><div class="ttname"><a href="struct__t_mutex.html#aa1d8803bb70576a417cba7092640ebd3">_tMutex::ownerOriginalPrio</a></div><div class="ttdeci">uint32_t ownerOriginalPrio</div><div class="ttdef"><b>Definition:</b> <a href="t_mutex_8h_source.html#l00029">tMutex.h:29</a></div></div>
<div class="ttc" id="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_html_ga2608713c70ae2de620f39566c023abe9"><div class="ttname"><a href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga2608713c70ae2de620f39566c023abe9">tMutexWait</a></div><div class="ttdeci">uint32_t tMutexWait(tMutex *mutex, uint32_t waitTicks)</div><div class="ttdef"><b>Definition:</b> <a href="t_mutex_8c_source.html#l00037">tMutex.c:37</a></div></div>
<div class="ttc" id="struct__t_mutex_html_af99fea13bfba6d0a457c2779fa8ecc5a"><div class="ttname"><a href="struct__t_mutex.html#af99fea13bfba6d0a457c2779fa8ecc5a">_tMutex::owner</a></div><div class="ttdeci">tTask * owner</div><div class="ttdef"><b>Definition:</b> <a href="t_mutex_8h_source.html#l00028">tMutex.h:28</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_ga312cd12071f2d18172b4020079af49a2"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga312cd12071f2d18172b4020079af49a2">tEventWaitCount</a></div><div class="ttdeci">uint32_t tEventWaitCount(tEvent *event)</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8c_source.html#l00206">tEvent.c:206</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gaeb48f2b93febc962f23d9a6a72db9d8e"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gaeb48f2b93febc962f23d9a6a72db9d8e">tTaskSched</a></div><div class="ttdeci">void tTaskSched(void)</div><div class="ttdoc">任务调度接口。通过它来选择下一个具体的任务，然后切换至该任务运行。 </div><div class="ttdef"><b>Definition:</b> <a href="t_core_8c_source.html#l00126">tCore.c:126</a></div></div>
<div class="ttc" id="struct__t_mutex_info_html_a16598f387191bb413e5c802b23e501ef"><div class="ttname"><a href="struct__t_mutex_info.html#a16598f387191bb413e5c802b23e501ef">_tMutexInfo::lockedCount</a></div><div class="ttdeci">uint32_t lockedCount</div><div class="ttdef"><b>Definition:</b> <a href="t_mutex_8h_source.html#l00040">tMutex.h:40</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gga79eea102ac8c9dc0bcce5f8c63ccc55aa6c274bf418a43d0cf80e68161aad9d8e"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aa6c274bf418a43d0cf80e68161aad9d8e">tErrorDel</a></div><div class="ttdef"><b>Definition:</b> <a href="tiny_o_s_8h_source.html#l00037">tinyOS.h:37</a></div></div>
<div class="ttc" id="struct__t_mutex_info_html_a2ad329dc18ddf3afd170e73535c5907a"><div class="ttname"><a href="struct__t_mutex_info.html#a2ad329dc18ddf3afd170e73535c5907a">_tMutexInfo::ownerPrio</a></div><div class="ttdeci">uint32_t ownerPrio</div><div class="ttdef"><b>Definition:</b> <a href="t_mutex_8h_source.html#l00036">tMutex.h:36</a></div></div>
<div class="ttc" id="tiny_o_s_8h_html"><div class="ttname"><a href="tiny_o_s_8h.html">tinyOS.h</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_ga5ca43de9442770133c4c2ac38e696049"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga5ca43de9442770133c4c2ac38e696049">tEventInit</a></div><div class="ttdeci">void tEventInit(tEvent *event, tEventType type)</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8c_source.html#l00021">tEvent.c:21</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gga79eea102ac8c9dc0bcce5f8c63ccc55aa255993b8e7a6ec085f545b2cb4b0e161"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aa255993b8e7a6ec085f545b2cb4b0e161">tErrorResourceUnavaliable</a></div><div class="ttdef"><b>Definition:</b> <a href="tiny_o_s_8h_source.html#l00036">tinyOS.h:36</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_ga21b4efbc4cb710d7d0e71678d2b13e53"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a></div><div class="ttdeci">void tTaskExitCritical(tTaskCritical_t status)</div><div class="ttdef"><b>Definition:</b> <a href="t_switch_8c_source.html#l00047">tSwitch.c:47</a></div></div>
<div class="ttc" id="struct__t_task_html_a6871573fefee3ad102e26a09e7a2f493"><div class="ttname"><a href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">_tTask::prio</a></div><div class="ttdeci">uint32_t prio</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00045">tTask.h:45</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_ga0bbda829b0d83072138caad66f98899a"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga0bbda829b0d83072138caad66f98899a">tEventWait</a></div><div class="ttdeci">void tEventWait(tEvent *event, tTask *task, void *msg, uint32_t state, uint32_t timeout)</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8c_source.html#l00035">tEvent.c:35</a></div></div>
<div class="ttc" id="struct__t_mutex_html_a8b516ab130f86e4b15ca025c98c3dc53"><div class="ttname"><a href="struct__t_mutex.html#a8b516ab130f86e4b15ca025c98c3dc53">_tMutex::event</a></div><div class="ttdeci">tEvent event</div><div class="ttdef"><b>Definition:</b> <a href="t_mutex_8h_source.html#l00025">tMutex.h:25</a></div></div>
<div class="ttc" id="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_html_ga8e1b65bea50a87032971eb167d411723"><div class="ttname"><a href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga8e1b65bea50a87032971eb167d411723">tMutexDestroy</a></div><div class="ttdeci">uint32_t tMutexDestroy(tMutex *mutex)</div><div class="ttdef"><b>Definition:</b> <a href="t_mutex_8c_source.html#l00180">tMutex.c:180</a></div></div>
<div class="ttc" id="struct__t_mutex_info_html_af99fea13bfba6d0a457c2779fa8ecc5a"><div class="ttname"><a href="struct__t_mutex_info.html#af99fea13bfba6d0a457c2779fa8ecc5a">_tMutexInfo::owner</a></div><div class="ttdeci">tTask * owner</div><div class="ttdef"><b>Definition:</b> <a href="t_mutex_8h_source.html#l00039">tMutex.h:39</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_gga38c1e3a16130027049cb697b78b5d11ca0c200498700fa5c347791d1a740848ad"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gga38c1e3a16130027049cb697b78b5d11ca0c200498700fa5c347791d1a740848ad">tEventTypeMutex</a></div><div class="ttdef"><b>Definition:</b> <a href="t_event_8h_source.html#l00028">tEvent.h:28</a></div></div>
<div class="ttc" id="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86_html_gae9796d3f7bdb820b16b7ca53a44bcbd0"><div class="ttname"><a href="group___xE4_xBB_xBB_xE5_x8A_xA1_xE7_xAE_xA1_xE7_x90_x86.html#gae9796d3f7bdb820b16b7ca53a44bcbd0">TINYOS_TASK_STATE_RDY</a></div><div class="ttdeci">#define TINYOS_TASK_STATE_RDY</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00017">tTask.h:17</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gab7c2dfbda696e43a8c35ab97731837a0"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab7c2dfbda696e43a8c35ab97731837a0">tTaskSchedRdy</a></div><div class="ttdeci">void tTaskSchedRdy(tTask *task)</div><div class="ttdoc">将任务设置为就绪状态 </div><div class="ttdef"><b>Definition:</b> <a href="t_core_8c_source.html#l00093">tCore.c:93</a></div></div>
<div class="ttc" id="struct__t_mutex_html_a16598f387191bb413e5c802b23e501ef"><div class="ttname"><a href="struct__t_mutex.html#a16598f387191bb413e5c802b23e501ef">_tMutex::lockedCount</a></div><div class="ttdeci">uint32_t lockedCount</div><div class="ttdef"><b>Definition:</b> <a href="t_mutex_8h_source.html#l00027">tMutex.h:27</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc">tErrorNoError</a></div><div class="ttdef"><b>Definition:</b> <a href="tiny_o_s_8h_source.html#l00034">tinyOS.h:34</a></div></div>
<div class="ttc" id="struct__t_task_html_a1b0c7bd4d79798ef4e0ce23894c9aeb2"><div class="ttname"><a href="struct__t_task.html#a1b0c7bd4d79798ef4e0ce23894c9aeb2">_tTask::state</a></div><div class="ttdeci">uint32_t state</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00047">tTask.h:47</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_ga6f232fb9d8361d1071e4f621468e0ee1"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a></div><div class="ttdeci">tTask * currentTask</div><div class="ttdoc">当前任务：记录当前是哪个任务正在运行 </div><div class="ttdef"><b>Definition:</b> <a href="t_core_8c_source.html#l00017">tCore.c:17</a></div></div>
<div class="ttc" id="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_html_gae12a3d5db0c3834e8a3837358f4f3302"><div class="ttname"><a href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#gae12a3d5db0c3834e8a3837358f4f3302">tMutexInit</a></div><div class="ttdeci">void tMutexInit(tMutex *mutex)</div><div class="ttdef"><b>Definition:</b> <a href="t_mutex_8c_source.html#l00023">tMutex.c:23</a></div></div>
<div class="ttc" id="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F_html_ga26ec3e3848541464c9ba38de67875e11"><div class="ttname"><a href="group___xE4_xBA_x92_xE6_x96_xA5_xE4_xBF_xA1_xE5_x8F_xB7_xE9_x87_x8F.html#ga26ec3e3848541464c9ba38de67875e11">tMutexNoWaitGet</a></div><div class="ttdeci">uint32_t tMutexNoWaitGet(tMutex *mutex)</div><div class="ttdef"><b>Definition:</b> <a href="t_mutex_8c_source.html#l00091">tMutex.c:91</a></div></div>
<div class="ttc" id="struct__t_mutex_info_html"><div class="ttname"><a href="struct__t_mutex_info.html">_tMutexInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="t_mutex_8h_source.html#l00033">tMutex.h:33</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_ga6f3aa47609478099b79d1520a9baf9b3"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f3aa47609478099b79d1520a9baf9b3">tTaskSchedUnRdy</a></div><div class="ttdeci">void tTaskSchedUnRdy(tTask *task)</div><div class="ttdoc">将任务从就绪列表中移除 </div><div class="ttdef"><b>Definition:</b> <a href="t_core_8c_source.html#l00102">tCore.c:102</a></div></div>
<div class="ttc" id="struct__t_mutex_html"><div class="ttname"><a href="struct__t_mutex.html">_tMutex</a></div><div class="ttdef"><b>Definition:</b> <a href="t_mutex_8h_source.html#l00024">tMutex.h:24</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_gae1e675e01faa9fd2a37ab29b2092d646"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gae1e675e01faa9fd2a37ab29b2092d646">tEventWakeUp</a></div><div class="ttdeci">tTask * tEventWakeUp(tEvent *event, void *msg, uint32_t result)</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8c_source.html#l00068">tEvent.c:68</a></div></div>
<div class="ttc" id="struct__t_task_html_a37707d87e42a484588393e5b3683ffbb"><div class="ttname"><a href="struct__t_task.html#a37707d87e42a484588393e5b3683ffbb">_tTask::waitEventResult</a></div><div class="ttdeci">uint32_t waitEventResult</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00059">tTask.h:59</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="t_mutex_8c.html">tMutex.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
